import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Reg from '../views/Reg.vue'
import Admin from '../views/Admin.vue'
import Car from '../views/car/Car.vue'
import Check from '../views/check/Check.vue'
import MaterialLog from '../views/material/MaterialLog.vue'
import Material from '../views/material/Material.vue'
import Task from '../views/task/Task.vue'
import Money from '../views/check/Money.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/reg',
    name: 'reg',
    component: Reg
  },
  {
    path: '/home',
    name: 'home',
    component: Admin,
    children:[
      {
        path: '/car',
        name: 'car',
        component: Car
      },
      {
        path: '/check',
        name: 'check',
        component: Check
      },
      {
        path: '/material',
        name: 'material',
        component: Material
      },
      {
        path: '/material_log',
        name: 'material_log',
        component: MaterialLog
      },
      {
        path: '/task',
        name: 'task',
        component: Task
      },
      {
        path: '/money',
        name: 'money',
        component: Money
      }
      
    ]
  },
  
  
  

]

const router = new VueRouter({
  routes
})

export default router
